package shuxue;

import java.util.Scanner;

public class yanhuisanjiao {
public static void main(String[] args) {
	int[] a = {0,1,5,8,12,17,13,30,38,47,18};
	//a = {0,1,5,8,12,17,13,30,38,47,18};
	Scanner scanner = new Scanner(System.in);
	int n = scanner.nextInt();
	System.out.println(a[n]);
}
}
